from pyquery import PyQuery as pq
html = '''
<div>
<ul>
<li class = "item-0"><a href = "link1.html">first item</a></li>
<li class = "item-1"><a href = "link2.html">second item</a></li>
<li class = "item-inactive"><a href = "link3.html">third item</a></li>
<li class = "item-1"><a href = "link4.html">fourth item</a></li>
<li class = "item-0"><a href = "link5.html">fif item</a>
</ul>
</div>
'''
doc = pq(html)
print(doc('li'))
doc = pq(url='https://www.baidu.com')
print(doc('title'))
import requests
doc = pq(requests.get('https://www.baidu.com').text)
print(doc('title'))
# 文件初始化
doc = pq(filename='demo.html')
print(doc('li'))

